<?php
require_once 'init_app.php';

set_time_limit(0); 

// Wildberries
$products = ORM::factory('product')
                ->where('shop_id', '=', 4102)
                ->where('is_parsed', '=', 0)
                ->limit(1000)
                ->find_all();
$n = 0;
foreach ($products as $product) {
    Model_ProductParser_FromShop_Wildberries::instance()->parse($product);
    
    $product->is_parsed = 1;
    $product->save();
    
    $n++; 
    usleep(500000);  
}

echo $n."\n";
echo 'ok';







